//
//  DZToolbox.m
//  ZhaoJin
//
//  Created by Darren on 15/5/2.
//  Copyright (c) 2015年 Darren Zheng. All rights reserved.
//

#import "DZUtility.h"

@implementation DZUtility


NSString *stringDataWithTimeInterval(int timerInterval) {
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timerInterval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd hh:mm"];
    NSString *showtime = [formatter stringFromDate:date];
    return showtime;
}

NSString *stringYearDataWithTimeInterval(int timerInterval) {
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timerInterval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy年MM月dd日"];
    NSString *showtime = [formatter stringFromDate:date];
    return showtime;
}

NSString *stringYearDataWithTimeOtherInterval(int timerInterval) {
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timerInterval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy/MM/dd"];
    NSString *showtime = [formatter stringFromDate:date];
    return showtime;
}

NSString *dateTimeWithNString(int timerInterval){
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timerInterval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy.MM.dd"];
    NSString *showtime = [formatter stringFromDate:date];
    return showtime;
}

NSString *dateTimeWithNStringGG(int timerInterval){
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timerInterval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSString *showtime = [formatter stringFromDate:date];
    return showtime;
}


@end
